class SynopsesController < ApplicationController
  def index
    @synopses = Synopsis.all
  end

  def show
    @synopsis = Synopsis.find(params[:id])
  end

  def new
    @synopsis = Synopsis.new
  end

  def create
    @synopsis = Synopsis.new(params[:synopsis])
    if @synopsis.save
      redirect_to @synopsis, :notice => "Successfully created synopsis."
    else
      render :action => 'new'
    end
  end

  def edit
    @synopsis = Synopsis.find(params[:id])
  end

  def update
    @synopsis = Synopsis.find(params[:id])
    if @synopsis.update_attributes(params[:synopsis])
      redirect_to @synopsis, :notice  => "Successfully updated synopsis."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @synopsis = Synopsis.find(params[:id])
    @synopsis.destroy
    redirect_to synopses_url, :notice => "Successfully destroyed synopsis."
  end
end
